\(\int \frac {\csc (x)}{\sec (x)+\tan (x)} \, dx\) [194]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 11 \[ \int \frac {\csc (x)}{\sec (x)+\tan (x)} \, dx=\log (\sin (x))-\log (1+\sin (x)) \]

[Out]

ln(sin(x))-ln(1+sin(x))

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {4476, 2786, 36, 29, 31} \[ \int \frac {\csc (x)}{\sec (x)+\tan (x)} \, dx=\log (\sin (x))-\log (\sin (x)+1) \]

[In]

Int[Csc[x]/(Sec[x] + Tan[x]),x]

[Out]

Log[Sin[x]] - Log[1 + Sin[x]]

Rule 29

Int[(x_)^(-1), x_Symbol] :> Simp[Log[x], x]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 36

Int[1/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x), x], x] -
Dist[d/(b*c - a*d), Int[1/(c + d*x), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]

Rule 2786

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[x^p*((a + x)^(m - (p + 1)/2)/(a - x)^((p + 1)/2)), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& EqQ[a^2 - b^2, 0] && IntegerQ[(p + 1)/2]

Rule 4476

Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x_)]^(n_.))^(p_), x_Symbol] :> Int[A
ctivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a*Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\cot (x)}{1+\sin (x)} \, dx \\ & = \text {Subst}\left (\int \frac {1}{x (1+x)} \, dx,x,\sin (x)\right ) \\ & = \text {Subst}\left (\int \frac {1}{x} \, dx,x,\sin (x)\right )-\text {Subst}\left (\int \frac {1}{1+x} \, dx,x,\sin (x)\right ) \\ & = \log (\sin (x))-\log (1+\sin (x)) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.82 \[ \int \frac {\csc (x)}{\sec (x)+\tan (x)} \, dx=-2 \log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )+\log (\sin (x)) \]

[In]

Integrate[Csc[x]/(Sec[x] + Tan[x]),x]

[Out]

-2*Log[Cos[x/2] + Sin[x/2]] + Log[Sin[x]]

Maple [A] (verified)

Time = 0.35 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.73

method result size
derivativedivides \(-\ln \left (\csc \left (x \right )+1\right )\) \(8\)
default \(-\ln \left (\csc \left (x \right )+1\right )\) \(8\)
risch \(-2 \ln \left (i+{\mathrm e}^{i x}\right )+\ln \left ({\mathrm e}^{2 i x}-1\right )\) \(21\)

[In]

int(csc(x)/(sec(x)+tan(x)),x,method=_RETURNVERBOSE)

[Out]

-ln(csc(x)+1)

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.18 \[ \int \frac {\csc (x)}{\sec (x)+\tan (x)} \, dx=\log \left (\frac {1}{2} \, \sin \left (x\right )\right ) - \log \left (\sin \left (x\right ) + 1\right ) \]

[In]

integrate(csc(x)/(sec(x)+tan(x)),x, algorithm="fricas")

[Out]

log(1/2*sin(x)) - log(sin(x) + 1)

Sympy [F]

\[ \int \frac {\csc (x)}{\sec (x)+\tan (x)} \, dx=\int \frac {\csc {\left (x \right )}}{\tan {\left (x \right )} + \sec {\left (x \right )}}\, dx \]

[In]

integrate(csc(x)/(sec(x)+tan(x)),x)

[Out]

Integral(csc(x)/(tan(x) + sec(x)), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 25 vs. \(2 (11) = 22\).

Time = 0.22 (sec) , antiderivative size = 25, normalized size of antiderivative = 2.27 \[ \int \frac {\csc (x)}{\sec (x)+\tan (x)} \, dx=-2 \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) + \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \]

[In]

integrate(csc(x)/(sec(x)+tan(x)),x, algorithm="maxima")

[Out]

-2*log(sin(x)/(cos(x) + 1) + 1) + log(sin(x)/(cos(x) + 1))

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.09 \[ \int \frac {\csc (x)}{\sec (x)+\tan (x)} \, dx=-\log \left (\sin \left (x\right ) + 1\right ) + \log \left ({\left | \sin \left (x\right ) \right |}\right ) \]

[In]

integrate(csc(x)/(sec(x)+tan(x)),x, algorithm="giac")

[Out]

-log(sin(x) + 1) + log(abs(sin(x)))

Mupad [B] (verification not implemented)

Time = 22.41 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.36 \[ \int \frac {\csc (x)}{\sec (x)+\tan (x)} \, dx=\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )-2\,\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right ) \]

[In]

int(1/(sin(x)*(tan(x) + 1/cos(x))),x)

[Out]

log(tan(x/2)) - 2*log(tan(x/2) + 1)